DNS

Category: Other

Syntax:
DNS host
DNS nickname
$DNS(host)
$DNS(nickname)

Converts hostnames into IP addresses, and vice versa. If a nickname is given, its hostname will be looked up with GetAddress, and DNS will continue as if you supplied that hostname directly.

When called as a function, it returns an IP address (if a hostname was given), a hostname (if an IP address was given), or an empty string (if ViRC couldn't look up a nickname or contact the DNS server). When called as a command, DNS will display the information in the active window.

Example:
// get my hostname as it appears on the IRC server
@l $host = $StrTokR(@ $GetAddress($N))

// convert to an IP address if necessary
if !$IsIP($host)
  @l $host = $DNS($host)
endif

// display the result
if [$host] == []
  MessageBox Could not find your IP address.
else
  MessageBox Your IP address is $host.
endif

See also: GetAddress


Next in "Other": Exit
Previous in "Other": CheckForUpdates
Next by name: DockToolbar
Previous by name: DLL
Up to all commands by name, all functions by name or commands and functions by category